package com.example.game_dafangdaxie.View;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

/***
 * 跳出界面
 * 有时间重新做，太过于简陋
 * Create by liuTong
 * 2021.9.27
 */
public class mDialog  {
    private int win;
    private Context context;
    private String[] winMessage={"平局","红方胜","蓝方胜"};

    public mDialog(Context context,int win) {
        this.win=win;
        this.context=context;
    }

    public void DialogShow(){
        AlertDialog.Builder dialog = new AlertDialog.Builder(context);
        dialog.setTitle("游戏结束");
        dialog.setMessage(winMessage[win]);
        dialog.setCancelable(false);
        dialog.setNegativeButton("再玩一次", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        dialog.show();
    }


}
